/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package rentcalculator.persist;

import java.util.ArrayList;
import java.util.List;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import rentcalculator.model.Property;

/**
 *
 * @author developer
 */
public class PropertyDao {
    
    public void add(Property p){
        Persist.getInstance().add(p);
        
        
    }
    
    
    public void remove(Property p){
        Persist.getInstance().remove(p);
    }
    
    public void update(Property p){
        Persist.getInstance().update(p);
    }
    
    
    public List<Property> findAll(){
        List<Property> ps;
        ps = (List<Property>)Persist.getInstance().findALL(Property.class);
        
        return ps;
    }
    
    public Property findById(long id){
        Object r;
        Property p;
        p = null;
        r = Persist.getInstance().findById(Property.class, id);
        if(r!= null) p = (Property)r;
        return p;
    }
    
    
    
    
}
